//package com.codermn.day719;
//
//import com.drew.imaging.jpeg.JpegMetadataReader;
//import com.drew.imaging.jpeg.JpegProcessingException;
//import com.drew.metadata.Directory;
//import com.drew.metadata.Metadata;
//import com.drew.metadata.Tag;
//
//import java.io.File;
//import java.io.IOException;
//import java.util.HashMap;
//import java.util.Iterator;
//
///**
// * @author jxau_scf
// * @date 2021/7/19 - 11:18
// */
//public class ReadPicExif {
//    public static HashMap<String, Object> readPicInfo(String file_path) {
//        HashMap<String, Object> map = new HashMap<String,Object>();
//        Tag tag = null;
//        File jpegFile = new File(file_path);
//        Metadata metadata;
//        try {
//            metadata = JpegMetadataReader.readMetadata(jpegFile);
//            Iterator<Directory> it = metadata.getDirectories().iterator();
//            while (it.hasNext()) {
//                Directory exif = it.next();
//                Iterator<Tag> tags = exif.getTags().iterator();
//                while (tags.hasNext()) {
//                    tag = (Tag) tags.next();
//                    System.out.println(tag.getTagName()+"--"+tag.getDescription());
//                }
//            }
//        } catch (JpegProcessingException e) {
//            e.printStackTrace();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        return map;
//    }
//    public static void main(String[] args) {
//        //传入照片的绝对路径
////        readPicInfo("C:\\Users\\pacer\\Desktop\\img\\others\\10.jpg");
//        readPicInfo("C:\\Users\\lenovo\\Desktop\\111.jpg");
//    }
//
//}
